<%! func Setting(w http.ResponseWriter,r *http.Request,str string) error %>

<%% import "github.com/infinitbyte/framework/modules/ui/common" %%>
<%% import "net/http" %%>

<% common.Head(w, "Setting","") %>
<% common.Body(w) %>
<% common.Nav(w,r,"Setting") %>



<div class="tm-middle">
    <div class="uk-container uk-container-center">

        <div class="uk-grid" data-uk-grid-margin="">
            <div class="tm-sidebar uk-width-medium-1-4 uk-hidden-small uk-row-first">



            </div>
            <div class="tm-main uk-width-medium-3-4">

                <div class="uk-alert" ><span id="domain-alert">Settings</span></div>

                <article class="uk-article">
                    <style type="text/css" media="screen">
                        #editor {
                            height:850px;
                            width: 100%;
                        }
                    </style>
                    <pre id="editor"><%==str %></pre>

                    <script src="/static/assets/ace/ace.js" type="text/javascript" charset="utf-8"></script>
                    <script src="/static/assets/ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
                    <script>



                        var langTools = ace.require("ace/ext/language_tools");
                        var editor = ace.edit("editor");
                        editor.session.setMode("ace/mode/yaml");
                        editor.setTheme("ace/theme/tomorrow");

                        editor.setOptions({
                            enableBasicAutocompletion: true,
                            enableSnippets: true,
                            enableLiveAutocompletion: true
                        });


                        var suggestions = [
                            {name: 'if', value: 'if', score: '1', meta: 'keyword'},
                        ];
                        var completer = {
                            getCompletions: function(editor, session, pos, prefix, callback) {
//                                for (var param in window.playerSkills) {
//                                    if (window.playerSkills.hasOwnProperty(param)) {
//                                        suggestions.push({name: param, value: param, score: '1', meta: 'spell'});
//                                    }
//                                }
                                callback(null, suggestions);
                            }
                        };

                        langTools.addCompleter(completer);

                    </script>

                </article>
                <button class="uk-button uk-button-primary" type="button">Save</button>

            </div>
        </div>

    </div>
</div>

<% common.Footer(w) %>
